<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app"></div>
<script src="../../JavaScript/vue.js"></script>
<script>
    const app = Vue.createApp({
        template: `
          <div class="App">
            <h3>{{ count }}</h3>
            <!--@click='事件处理方法的方法名'-->
            <button @click="changeCount(-1)">-1</button>
            <button @click="changeCount(1)">+1</button>
          </div>
        `,
        data() {
            return {
                count: 0
            }
        },
        // methods对象里面写的是事件处理方法
        methods: {
            changeCount(step) {
                console.log(this)//指向的是app
                this.count+=step
            }
        }
    })
    app.mount("#app")
</script>
</body>
</html>